<%--
  Created by IntelliJ IDEA.
  User: kang
  Date: 2022/2/20
  Time: 15:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>account</title>
</head>
<body>
    <table border="1" cellspacing="0">
        <tr>
            <th>id</th>
            <th>姓名</th>
            <th>金额</th>
            <th>更新时间</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${data.list}" var="account">
            <tr>
                <td>${account.aid}</td>
                <td>${account.aname}</td>
                <td>${account.money}</td>
                <td>
                    <fmt:formatDate value="${account.updatetime}" pattern="yy-MM-dd hh:mm:ss"/>
                </td>
                <td>
                    <a href="${pageContext.request.contextPath}/update.jsp?aid=${account.aid}&data=${data}">修改</a>
                    <a href="${pageContext.request.contextPath}/account/del?id=${account.aid}&pageSize=${data.pageSize}">删除</a>
                </td>
            </tr>
        </c:forEach>
    </table>

    <div>
        <a href="${pageContext.request.contextPath}/account/findAll?pageNum=1&pageSize=${data.pageSize}">首页</a>
        <a href="${pageContext.request.contextPath}/account/findAll?pageNum=${data.isFirstPage ? 1:data.prePage}&pageSize=${data.pageSize}">上一页</a>
        <a href="${pageContext.request.contextPath}/account/findAll?pageNum=${data.isLastPage ? data.pages:data.nextPage}&pageSize=${data.pageSize}">下一页</a>
        <a href="${pageContext.request.contextPath}/account/findAll?pageNum=${data.pages}&pageSize=${data.pageSize}">尾页</a>

        第<font color="red">${data.pageNum}</font>页
        总共<font color="red">${data.pages}</font>页
        总共<font color="red">${data.total}</font>条
    </div>
    <div>
        <h1>
            <a href="${pageContext.request.contextPath}/add.jsp">add</a>
        </h1>
    </div>
</body>
</html>
